<template>
	<view class="lists">
		<u-toast ref="uToast"></u-toast>
		<u-no-network></u-no-network>

		<view class="lists__date">
			<text class="lists__date-text" @click="showDate = true">{{year}}年</text>

			<u-icon name="arrow-down-fill" color="#2979ff" size="30"></u-icon>
		</view>

		<u-cell-group>
			<u-cell-item :arrow="false" :use-label-slot="true" bg-color="#ffffff" class="lists__item "
				v-for="(item,index) in lists" :key="index">
				<view class="list__title" slot="title">{{item.showKey}}</view>
				<view class="flex lists__des" slot="label">
					<view class="">
						我的：<text class="lists__tip">{{item.mineTotal}}</text>
					</view>
					<view class="ml-20">
						代理：<text class="lists__tip">{{item.childrenTotal}}</text>
					</view>
				</view>
				<view class="" slot="right-icon">
					{{item.allTotal}}户
				</view>
			</u-cell-item>
		</u-cell-group>
		<!-- <u-empty text="暂无数据" mode="list"></u-empty> -->
		<u-picker v-model="showDate" mode="time" :params="params" :default-selector="[0]"
			@confirm="pickerConfirm"></u-picker>
	</view>
</template>

<script>
	export default {

		data() {
			return {
				lists: [],
				showDate: false,
				data: {
					activityStatus: "0",
					year: "2023"
				},
				yearList: [],
				year: "",
				params: {
					year: true,
					month: false,
					day: false,
					hour: false,
					minute: false,
					second: false
				},
				type: "",
			}
		},
		onLoad(options) {
			this.type = options.type;
		},
		mounted() {
			this.year = new Date().getFullYear();
			this.data.year = this.year;
			this.data.activityStatus = this.type;
			this.getLists()
		},
		methods: {
			getLists() {
				this.$zx.order_api.merchantCountList(this.data).then((data) => {

					this.lists = data;

				});
			},
			pickerConfirm(e) {

				this.year = e.year;
				this.data.year = this.year;
				this.getLists()
			}
		},
	}
</script>

<style scoped lang="scss">
	.lists {
		color: #333333 !important;
		padding: 20rpx;

		&__item {
			border-radius: 20rpx;

			// margin: 20rpx;
		}

		&__title {}

		&__des {
			font-weight: bold;
		}

		&__tip {
			color: #9D60FF;
		}

	}
</style>